package com.wenx.completablefuture;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

public class Test1 {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        // 创建一个带result的CompletableFuture
        CompletableFuture<String> helloCompletablefuture = CompletableFuture.completedFuture("hello completablefuture");
        System.out.println(helloCompletablefuture.get());
        System.out.println(helloCompletablefuture.join());

    }

}
